//
//  ForgetViewController.m
//  XiangMuB
//
//  Created by lanou3g on 16/8/16.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "ForgetViewController.h"
#import <AVOSCloud/AVOSCloud.h>
#import "NSObject+alertView.h"
#import "LoadViewController.h"
@interface ForgetViewController ()
@property (strong, nonatomic) IBOutlet UITextField *emailTextFired;
@property (strong, nonatomic) IBOutlet UIButton *sendButton;

@end

@implementation ForgetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
   
    
    self.title = @"密码重置";
}


//发送
- (IBAction)sender:(UIButton *)sender {
    
    
    [AVUser requestPasswordResetForEmailInBackground:self.emailTextFired.text block:^(BOOL succeeded, NSError *error) {
        if (succeeded) {
            
            [NSObject alterString:@"发送成功"];
            
            LoadViewController *load =[LoadViewController new];
            [self.navigationController pushViewController:load animated:YES];
            
            
            
        } else {
            
            [NSObject alterString:@"发送失败"];
            
            NSLog(@"%@",error);
        }
    }];

    
    
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
